using System;
using System.Windows;
using Microsoft.Win32;
using System.Windows.Controls; // 添加此命名空间引用
using System.Collections.ObjectModel;

namespace gcpN
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        // 添加模块集合
        public ObservableCollection<Module> Modules { get; } = new ObservableCollection<Module>();

        private void ClearLog_Click(object sender, RoutedEventArgs e)
        {
            LogTextBox.Clear();
        }

        private void CloseMenuItem_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void CheckUpdateMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var updateWindow = new UpdateWindow
            {
                Owner = this
            };
            
            // 初始化要更新的模块
            Modules.Clear();
            Modules.Add(new Module { Name = "gcpN" });
            Modules.Add(new Module { Name = "GitHub Copilot Proxies" });
            
            updateWindow.ShowDialog();
        }
    }
    
    // 模块数据模型
    public class Module
    {
        public string Name { get; set; }
        public bool IsSelected { get; set; }
    }
}
